{% extends 'base.html' %}

{% block title %}
	{{ page }}
{% endblock %}

{% block menu %}
	<div class="menu">
	<table id="main_menu">
	<tr>
	{% for key, value in menus.items() %}
		<td>
		<a href= "{{url_for(key)}}" >
            <h2>{{ value }}</h2>
        </a>
		</td>
	{% endfor %}
	</tr>
	</table>
	</div>
{% endblock %}

{% block container %}
	<div class="container">
    	<h1> {{ page }} {{ text }}</h1>
	</div>
<div class="form">
{% if 'login' in data %}
<form method="post">
   {{ lgn.csrf_token() }}
    <div>
	{{ lgn.login.label }}
	{{ lgn.login }}
    <br>
	{{ lgn.passwd.label }}
	{{ lgn.passwd }}
    </div>
    <div>
	{{ lgn.login_btn }}
    </div>
</form>
{% elif 'ch_admin' in data %}
<br>
<a href="logout">Выход</a>
<br><br><hr>
<form method="post">
   {{ ch_pass.csrf_token() }}
   <div>
	   <p>Смена имени пользователя</p>
   {{ ch_admin.login.label }}
   {{ ch_admin.login }}
   </div>
   <br>
   <div>
   {{ ch_admin.save_login }}
   </div>
</form>
   <br><br><hr>
<form method="post">
   {{ ch_pass.csrf_token() }}
	<div>
		<p>Смена пароля</p>
	{{ ch_pass.new_pass.label }}
	{{ ch_pass.new_pass }}
	<br>
	{{ ch_pass.confirm_pass.label }}
	{{ ch_pass.confirm_pass }}
	</div>
	<br>
	<div>
	{{ ch_pass.save_pass }}
	</div>
</form>
{% endif %}
</div>
{% endblock %}

{% block content %}
{% endblock %}

{% block foot %}
	<div class="foot">
		<a>
		{% for txt in foot %}
			{{ txt }}
			<br>
		{% endfor %}
		</a>
		<a href="{{ url }}" target="_blank">Сайт проекта</a>
	</div>
{% endblock %}
